/**
 * Created by minigci.he on 16/10/31.
 */

function *helloWoldGenerator(){
    yield 'hello';
    yield 'world';
    return 'ending'
}

var hw = helloWoldGenerator();
console.log(hw.next())  // Object {value: "hello", done: false}
console.log(hw.next())  // Object {value: "world", done: false}
console.log(hw.next())  // Object {value: "ending", done: true}
console.log(hw.next())  // Object {value: undefined, done: true}
